package so.dun.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("/welcome")
public class HelloController {
    static final Logger logger = LogManager.getLogger(HelloController.class.getName());
    @RequestMapping(method = RequestMethod.GET)
    public String printWelcome(ModelMap model) {
        logger.info("Spring MVC Log4j!");
        model.addAttribute("message", "Spring 4 MVC Hello World");
        return "hello";

    }

}


